byte_array

An array of bytes. This type is immutable.

Since

0.6.0

Constructors

Link copied to clipboard
pure constructor(hex: text)

Creates a byte_array from a hexadecimal string.

pure constructor(list: list<integer>)

Creates a byte_array from a list of integers.

Functions

Link copied to clipboard
pure function decode(): text
Link copied to clipboard
pure function empty(): boolean

Returns true if the byte_array is empty, otherwise returns false.

Link copied to clipboard
static function from_base64(value: text): byte_array

Creates a byte_array from a Base64 string.

Link copied to clipboard
pure static function from_hex(value: text): byte_array

Creates a byte_array from a hexadecimal string.

Link copied to clipboard
pure static function from_list(list: list<integer>): byte_array

Creates a byte_array from a list of integers.

Link copied to clipboard
pure function join_to_text([separator: text], [prefix: text], [postfix: text], [limit: integer?], [truncated: text], [transform: (integer) -> text]): text

Creates a text from all the elements separated using separator and using the given prefix and postfix if supplied.

If the iterable is large, you can specify a non-negative value of limit, in which case only the first limit of elements will be appended, followed by the truncated text (which defaults to "...").

Link copied to clipboard
(alias) pure function len(): integer

Returns the number of bytes.

Alias
Link copied to clipboard
pure function repeat(n: integer): byte_array

Repeats the byte_array 'n' times.

Link copied to clipboard
pure function reversed(): byte_array

Returns a reversed copy of the byte_array.

Link copied to clipboard
pure function sha256(): byte_array

Returns the SHA256 digest of the byte_array.

Link copied to clipboard
pure function size(): integer

Returns the number of bytes.

Link copied to clipboard
pure function sub(start: integer): byte_array

Returns a sub-array of the byte_array from the specified start index.

pure function sub(start: integer, end: integer): byte_array

Returns a sub-array of the byte_array from the specified start index to the end index.

Link copied to clipboard
pure function to_base64(): text

Returns a Base64 representation of the byte_array.

Link copied to clipboard
pure function to_hex(): text

Returns a hexadecimal representation of the byte_array.

Link copied to clipboard
pure function to_list(): list<integer>

Converts the byte_array to a list of integers.

Link copied to clipboard
(alias) pure function toList(): list<integer>

Converts the byte_array to a list of integers.

Alias